# -*- coding:utf-8 -*-
import jsonschema

resp = {
    "name": "还是沈老师",
    "number": "13968956432",
    "password":"562389",
    "birtnday":"1993-05-14"
}
schema = \
    {
    "type": "object",
    "propertise":
    {
        "success": {"const": True},
        "code": {"const":10000},
        "message": {"pattern": "^操作"}
    },
    "reuired": ["success", "code", "message", "data"]
    }
# 调用jsonschema中校验方法，校验数据
res = jsonschema.validate(instance=resp, schema=schema)
print(res)
